<?
/*
***************MainForm******************	
*	Created by Doron Rainer		*
*****************************************
*/
class button extends form {
	private $label,$type,$style,$click,$value;
	
	function button($val,$onclick,$styl="")
	{
		$this->label=$lab;
		$this->type="button";
		$this->click = $onclick;
		$this->value = $val;
		$this->style=$styl;
		
	}

	function add($form)
	{
		$form->insert($this);
	}
	
	function del($form)
	{
		$form->remove($this->name);
	}
	function insert($text)
	{
		$numofo = $this->numOfOptions;
		$this->values[$numofo] = $text;
		$this->numOfOptions++;
	}
	protected function createObject()
	{
		$click = $this->click;
		$value = $this->value;
		$style = $this->style;
		$out = "<button onClick='{$click}'";
		if ($style != "")
		{
			$out .= "style='{$style}'";
		} 
		$out .= ">{$value}</button>\n";
		return $out;
				
	}
	function getType()
	{
		return $this->type;
	}
	function getLabel()
	{
		return $this->label;
	}
	function getStyle()
	{
		return $this->style;
	}
	function getValue()
	{
		return $this->value;
	}
	function getName()
	{
		return $this->name;
	}
	
	//Sets
	function setLabel($label)
	{
		$this->label=$label;
	}
	function setStyle($style)
	{
		$this->style=$style;
	}
	function setValue($value)
	{
		$this->value=$value;
	}
	function setName($name)
	{
		$this->name=$name;
	}

}
?>
